Combinatorial Solutions of Multidimensional Divide-and-Conquer Recurrences
نویسنده
چکیده
In this paper we use combinatorial techniques to solve recurrence relations in two variables of the form T(N,k) = 2 T(N/2,k) + T(N,k-l) + f(N) and related recurrences. These recurrences arise in the analysis of algorithms based on a paradigm called "multidimensional divide-and-conquer". The analyses that we present are interesting from a combinatorial view, and show that certain algorithms are very efficient. ^ h i s work was done while the author was visiting the Departement of Computer Science at Carnegte-MeMon Universi ty end was supported in part by the Office of Naval Research under Contract N 0 0 0 1 4 7 6 C 0 3 7 0 . 29 May 1979 Combinatorial Solutions of Recurrences 1 1 . Introduction In this paper we shall study the problem of (exactly) analyzing Multidimensional Divide-and-Conquer (MDC) algorithms described by Bentley [1978]. The execution costs of these algorithms are usually described by recurrence relations in two variables of the form T(N,k) « a T(N/2,k) 4 b T(N,k-l) + f(N) or T(N,k) = a T(N/2,k) + b T(N/2,k-l) + f(N) with initial values T(l,k) = 0( l ) and T(N,2) = g(N) where a and b are integers, and f and g are functions of N. These recurrences have only been roughly solved for fixed k. The purpose of this paper is to solve these recurrences exactly using combinatorial techniques. The exact analysis gives us the constant factor in the expression of T(N,k) as a function of k, and also the ability to compare MDC algorithms with more obvious algorithms. In Section 2 we sketch a particular MDC algorithm and derive the recurrence describing its running time. We solve that recurrence precisely in Section 3, and in Section 4 we use the combinatorial solution to describe the behavior of the algorithm. Section 5 is a collection of MDC recurrences and their solutions. In Section 6 we extend the solution method to more general recurrences, and conclusions are offered in Section 7. 2. The All-Points ECDF Algorithm In this section we shall investigate a particular MDC algorithm and show how its recurrence can be derived; this algorithm is due to Bentley and Shamos and is described in Bentley [1978]. Our purpose in this section is not to learn all the details of the algorithm, but rather to understand how its recurrence arises. We say that a point X=(xj^..,xk) in an Euclidian k-space dominates point V iff Xj z y{ for all i. The rank r(X) of a point X is the number of points dominated by X. Given N points in k-space, the All-Points ECDF Problem is to compute the rank of each. The following is a sketch of Algorithm ECDFk described by Bentley [1978] for solving this problem on a set S of N points in k-space. 1 -If the number of points, N, in S is one, then solve the problem in 0(1) time; if the dimension, k, of the point set is two, then solve the problem in 0(N Ig N) time. If either of these conditions holds, return to the caller; otherwise continue to Step 2. 2.Using a hyperplane normal to one of the coordinate axes (say the x-axis), divide 29 May 1979 Combinatorial Solutions of Recurrences 2 S in two subsets A and B, each containing N/2 points. 3.Recursively solve the all-points ECDF problem on A and B (each problem of N/2 points in k-space). 4.Remarking that any point of B dominates each point of A in x-coordinate, we may remove this coordinate and solve the reduced problem (of finding for each point in B how many points of A it dominates) on the N points projected in (k-l)-space. Let us denote by T(N,k) the time for solving the all-points ECDF problem on a set of N points in k-space. Since Step 2 can be performed in time 0(N), we find the recurrence relation From Step 1 we have the boundary conditions^ T(N,2)=0(N log N) T< 1,10-0(1). To analyze the above recurrence we must remove the "thetas". We will therefore solve the related recurrence T(N,k)=2 T(N/2,k)+T(N,k-l)+N (2) T(N,2)=N log N T< 1,10-1. The solution of the Equation 2 is always within a constant factor of solution of Equation 1, and therefore is precise enough for our purposes. 3. Combinatorial Solution We shall first solve Equation 2 assuming that N =» 2P. For this purpose, we define B(p,k)=T(2P,k)/2P . Dividing both sides of Equation 2 by N and substituting this definition of B gives the reduced T(N,k)=2 T(N/2,k)+T(N,k-l)+0(N). (1) system B(p,k)~B(p-l,k)+B(p,k-l)+l B(p,2)=p B(0,k)=l. (3) We may easily verify that the solution to Equation 3 is Her© I* N denotes always ! o * 2 N. 29 May 1979 Combinatorial Solutions of Recurrences 3 The solution of Equation 2 is now immediate; it is f f lgN+(k-2) \ AlgN+(k-3)\ "I m > J,k) = N L 2 1 k-2 I + \ k-1 / 1 J. ( 5 > T(N,I We know now what the solution is; we do not, however, know why it is so. To achieve a more intuitive understanding of this solution, we shall transform Equation 3 by defining A(p,k)=B(p,k)+l and find a combinatorial interpretation of the new recurrence A(p,k)=A(p-l,k)+A(p,k-l) (6) A(p,2)=p-.-l A(0,k)=2. Let us consider the net of Figure 1. The number W( a b)(p,k) of ways from (a,b) to (p,k) using only edges in the network satisfies the recurrence W b(p,k)=W b (p -1 ,k>+W b(p,k-1) W a b 2(p,k) 4 W 2 > 1(p,k) which yields Equation 4. In the next section, we shall study several other recurrences using this method, which we can summarize as follows. -Manipulate the initial recurrence until obtaining a form similar to Equation 6. -Build the corresponding net, and (if possible) expand it to make the bounds [p+k-2\ fp+k-3\ . . . B(p,k) = 2 V k-2 / + [ k-1 / 1. w
منابع مشابه
Divide-and-conquer recurrences associated with generalized heaps, optimal merge, and related structures
An elementary approach is given to studying the recurrence relations associated with generalized heaps (or d-heaps), cost of optimal merge, and generalized divide-and-conquer minimization problems. We derive exact formulae for the solutions of all such recurrences and give some applications. In particular, we present a precise probabilistic analysis of Floyd’s algorithm for constructing d-heaps...
متن کاملExact Asymptotics of Divide-and-Conquer Recurrences
The divide-and-conquer principle is a majoi paradigm of algorithms design. Corresponding cost functions satisfy recurrences that directly reflect the decomposition mechanism used in the algorithm. This work shows that periodicity phenomena, often of a fractal nature, are ubiquitous in the performances of these algorithms. Mellin transforms and Dirichlet series are used to attain precise asympto...
متن کاملNotes on Better Master Theorems for Divide-and-Conquer Recurrences
Techniques for solving divide-and-conquer recurrences are routinely taught to thousands of Computer Science students each year. The dominant approach to solving such recurrences is known as the Master Method [2]. Recently, Akra and Bazzi [1] discovered a surprisingly elegant generalization of the Master Method that yields a very simple formula for solving most divideand-conquer recurrences. In ...
متن کاملGeometrical Interpretation of the Master Theorem for Divide-and-conquer Recurrences
We provide geometrical interpretation of the Master Theorem to solve divide-and-conquer recurrences. We show how different cases of the recurrences correspond to different kinds of fractal images. Fractal dimension and Hausdorff measure are shown to be closely related to the solution of such recurrences.
متن کاملFree Vibration Analysis of Repetitive Structures using Decomposition, and Divide-Conquer Methods
This paper consists of three sections. In the first section an efficient method is used for decomposition of the canonical matrices associated with repetitive structures. to this end, cylindrical coordinate system, as well as a special numbering scheme were employed. In the second section, divide and conquer method have been used for eigensolution of these structures, where the matrices are in ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- J. Algorithms
دوره 1 شماره
صفحات -
تاریخ انتشار 1980